class HomeController < ApplicationController
  auto_complete_for :trace, :event
  protect_from_forgery :only => [:create, :update, :destroy] 

  def auto_complete_belongs_to_for_trace_event_title
    @events = Event.find(
      :all,
      :conditions => ['LOWER(title) LIKE ?', "%#{params[:event][:title]}%"],
      :limit => 10
    )
    render :inline => '<%= model_auto_completer_result(@events, :title) %>'
  end
  
  def index
    # For the remote_form_for call on the home page.
    @trace = Trace.new()
    @traces = Trace.getLatest
  end
end

